package ar.edu.utn.frba.dds.tp.tests.DateParser;

import static org.junit.Assert.*;

import java.util.Date;

import org.joda.time.Days;
import org.joda.time.LocalDate;
import org.junit.Before;
import org.junit.Test;

import ar.edu.utn.frba.dds.tp.code.dateParser.ParserFecha;

public class ManejoDeOperacionesEntreFechasFechaTest {

	/*
	 * Tester: Ezequiel Gambaccini
	 */
	
	private Date aDate;
	private Date otherDate;
	
	@Before
	public void setUp() throws Exception {
		 aDate = new LocalDate(2012,3,21).toDate();
		 otherDate = new LocalDate(2012,3,25).toDate();
	}
	

	@Test
	public void testDiasEntre() {
		Days first_diff = ParserFecha.DiasEntre(aDate, otherDate);
		Days second_diff = ParserFecha.DiasEntre(otherDate, aDate);
		assertTrue(first_diff.equals(second_diff));
	}

	@Test
	public void testEstaAntes() {
		assertTrue(ParserFecha.EstaAntes(aDate, otherDate));
	}
	
	@Test
	public void testNoEstaAntes(){
		assertFalse(ParserFecha.EstaAntes(otherDate, aDate));
	}

}
